<?php
class Zend_View_Helper_SitePath extends Zend_View_Helper_Abstract {

	/**
	 * @var string
	 */
	private $_separator;

	public function __construct() {
		$this->_separator = '';
	}

	public function sitePath() {
		$request = Zend_Controller_Front::getInstance()->getRequest();

		$return = array();
		$i = 0;

		foreach ($this->view->breadcrumb as $key => $value) {
			if (empty($value))
				$return[] = '<li'.($i==count($this->view->breadcrumb)-1 ? ' class="last"':'').'><span>'.$key.'</span></li>';
			else
				$return[] = '<li'.($i==count($this->view->breadcrumb)-1 ? ' class="last"':'').'>'.($i==0 ? 'Você está em':'').' <a href="'.htmlspecialchars($value).'">'.$key.'</a>'.($i==count($this->view->breadcrumb)-1 ? '':' &raquo; ').'</li>';

			$i++;
		}

		return '<ul>' . implode($this->_separator, $return) . '</ul>';
	}

}